<template>
  <view class="set">
    <button @click="logout" class="logout">
      <text>退出登录</text>
    </button>
  </view>
</template>

<script setup>
import { onLoad } from '@dcloudio/uni-app';

function logout() {
  uni.showToast({
    title: '退出登录成功',
    icon: 'success',
    duration: 500,
    mask: true,
    complete() {
      uni.removeStorageSync('token')
      uni.removeStorageSync('user')
      uni.removeStorageSync('heightForMore')
      // uni.redirectTo({
      //   url: '/pages/login/login'
      // });
    }
  })
}
onLoad(() => {
  uni.setNavigationBarTitle({
    title: '设置'
  })
})
</script>

<style lang=" scss" scoped></style>
